
import { userMenu } from '@/api/system/user'
import util from '@/libs/util'

const storage = {}
// eslint-disable-next-line no-unused-vars
// token
storage.TOKEN = 'AUTHORIZATION_TOKEN'
// token 消息头key
storage.HEADER_TOKEN = 'Authorization'
// 用户信息key
storage.USER = 'USER_INFO'

storage.USER_MENU = 'USER_MENU'

storage.set = function (key, value) {
  window.localStorage.setItem(key, value)
}

storage.remove = function (key) {
  window.localStorage.removeItem(key)
}

storage.get = function (key) {
  return window.localStorage.getItem(key)
}

storage.setToken = function (value) {
  storage.set(storage.TOKEN, value)
}
storage.getToken = function () {
  return storage.get(storage.TOKEN)
}

storage.removeToken = function () {
  return storage.remove(storage.TOKEN)
}

storage.removeUser = function () {
  return storage.remove(storage.USER)
}

storage.setUserInfo = function (value) {
  storage.set(storage.USER, value)
}
storage.getUserInfo = function () {
  return storage.get(storage.USER)
}
export default storage
